import request from "@/utils/request";

// 获取请购列表
export function getRequestListApi(query, data) {
  return request({
    url: "/system/apply/list",
    method: "post",
    params: query,
    data,
  });
}

// 获取请购列表(询比价)
export function getRequestChooseListApi(query, data) {
  return request({
    url: "/system/apply/selectMaterialInfoList",
    method: "post",
    params: query,
    data,
  });
}

// 获取请购明细列表
export function getRequestDetailListApi(query, data) {
  return request({
    url: "/system/apply/selectMaterialDetailList",
    method: "post",
    params: query,
    data,
  });
}

// 新增请购
export function addRequestApi(data) {
  return request({
    url: "/system/apply",
    method: "post",
    data,
  });
}

// 撤销请购
export function cancelRequestApi(data) {
  return request({
    url: "/system/apply/checkErpPur",
    method: "post",
    data,
  });
}
// 编辑请购
export function editRequestApi(data) {
  return request({
    url: "/system/apply/edit",
    method: "post",
    data,
  });
}

// 获取请购详情
export function getRequestDetailApi(purchaseApplyId) {
  return request({
    url: `/system/apply/selectPurchaseInfo`,
    method: "get",
    params: { purchaseApplyId },
  });
}

// 获取请购表格详情
export function getRequestTableApi(purchaseApplyId) {
  return request({
    url: `/system/apply/selectMaterList`,
    method: "get",
    params: { purchaseApplyId },
  });
}

// 删除请购
export function deleteRequestId(purchaseApplyId) {
  return request({
    url: `/system/apply/del`,
    method: "get",
    params: { purchaseApplyId },
  });
}

// 审核
export function checkRequestApi(data) {
  return request({
    url: "/system/apply/checkErpPur",
    method: "post",
    data,
  });
}


// 审核进度
export function selectAuditList(deliveryApplyId) {
  return request({
    url: `/system/apply/selectAuditList`,
    method: "get",
    params: { deliveryApplyId },
  });
}

export function selectRelPurchaseApplyList(data) {
  return request({
    url: "/system/purContract/selectRelPurchaseApplyList",
    method: "post",
    data,
  });
}

// 获取运维工单列表
export function getWorkListApi() {
  return request({
    url: `/system/MaintenanceApply/selectMainOrderApplyPullList`,
    method: "get",
  });
}

// 获取项目列表
export function projectListRequest(data) {
  return request({
    url: `/system/project/selectProjectShowList`,
    method: "post",
    data
  });
}

// 获取项目列表
export function projectListRequest2(data) {
  return request({
    url: `/system/project/selectProjectCheckPassShowList`,
    method: "post",
    data
  });
}